import { default as request, cloud } from '@/framework/utils/request'

/**
 * 分页查询监控分组所有数据
 */
export function getPage(params) {
  return request({
    url: `${cloud.videofusion}/videoGroup/page`,
    method: 'get',
    params
  })
}

/**
 * 分页查询监控分组绑定的监控信息
 */
export function getList(params) {
  return request({
    url: `${cloud.videofusion}/videoGroup/getGroupMonitorInfo`,
    method: 'get',
    params
  })
}

/**
 * 新增监控查询监控信息
 */
export function getAddGroupMonitorPage(params) {
  return request({
    url: `${cloud.videofusion}/videoGroup/addGroupMonitorInfo`,
    method: 'get',
    params
  })
}

/**
 * 新增监控分组接入视频数据
 */
export function addVideoGroupMonitor(data) {
  return request({
    url: `${cloud.videofusion}/videoGroupMonitor/add`,
    method: 'post',
    data
  })
}

/**
 * 删除监控分组接入视频数据
 */
export function delVideoGroupMonitor(data) {
  return request({
    url: `${cloud.videofusion}/videoGroupMonitor/delete`,
    method: 'post',
    data
  })
}

/**
 * 根据监控分组id统计该监控分组下绑定监控数量
 */
export function countByGroupId(data) {
  return request({
    url: `${cloud.videofusion}/videoGroupMonitor/countByGroupId`,
    method: 'post',
    data
  })
}

/**
 * 删除监控分组数据
 */
export function delVideoGroup(id) {
  return request({
    url: `${cloud.videofusion}/videoGroup/delete`,
    method: 'post',
    data: {
      id
    }
  })
}

/**
 * 根据监控分组id获取授权的用户id
 */
export function getByGroupIdToUserId(groupId) {
  return request({
    url: `${cloud.videofusion}/videoGroupRole/getByGroupIdToUserId`,
    method: 'post',
    data: {
      groupId
    }
  })
}

/**
 * 监控分组进行用户授权
 */
export function empowerUser(data) {
  return request({
    url: `${cloud.videofusion}/videoGroupRole/empower`,
    method: 'post',
    data
  })
}

/**
 * 播放视频文件
 */
export function getPlayUrl(params) {
  return request({
    url: `${cloud.videofusion}/play/play`,
    method: 'get',
    params
  })
}

/**
 * 播放路径截图
 */
export function screenImage(params) {
  return request({
    url: `${cloud.videofusion}/play/screenImage`,
    method: 'get',
    params
  })
}
